package com.hzit;

import java.util.Scanner;

/**
 * 作者：Dzm
 * 时间：2024-07-06-9:13
 * 功能：
 */
public class Test02 {

    public static void main(String[] args) {

        test01();
    }

    private static void test01() {
        Scanner scanner = new Scanner(System.in);

        //定义奇数计数器
        int count = 0;

        //循环输入10个数
        System.out.println("请输入10个数：");
        for (int i = 0; i < 10; i++) {
            int num = scanner.nextInt();
            //是奇数计数器+1
            if(num % 2 == 1) {
                count++;
            }
        }

        System.out.println("输入的10个数中奇数个数" + count + "，偶数个数" + (10-count));
    }

}
